package example.html5.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import gwtlx.html5.client.Browser;
import gwtlx.html5.client.forms.TextBox;


/** HTML5 components example entry point. */
public class Html5Example implements EntryPoint {

    /** This is the entry point method. */
    public void onModuleLoad() {
        final RootPanel panel = RootPanel.get("container");

        if (Browser.hasPlaceholderSupport()) {
            panel.add(new Label("Your browser has native HTML5 placeholder attribute support. GWT components will use it!"));
        } else {
            panel.add(new Label("Your browser DOES NOT supports HTML5 placeholder attribute. GWT components will emulate it."));
        }
        final TextBox html5textBox = new TextBox();
        html5textBox.setPlaceholder("A placeholder text");

        panel.add(html5textBox);

        if (Browser.hasWebWorkerSupport()) {
            panel.add(new Label("Your browser supports WebWorkers!"));
        } else {
            panel.add(new Label("Your browser DOES NOT supports WebWorkers :-("));
        }
    }
}
